package org.light.jpa.verb;

import java.util.ArrayList;
import java.util.List;

import org.light.core.Verb;
import org.light.core.Writeable;
import org.light.domain.Domain;
import org.light.domain.JavascriptBlock;
import org.light.domain.JavascriptMethod;
import org.light.domain.Method;
import org.light.domain.Signature;
import org.light.domain.Statement;
import org.light.domain.Type;
import org.light.easyui.EasyUIPositions;
import org.light.exception.ValidateException;
import org.light.jpa.core.JpqlReflector;
import org.light.utils.MybatisSqlReflector;
import org.light.utils.StringUtil;
import org.light.utils.WriteableUtil;

public class FindFullInfoById extends org.light.verb.FindFullInfoById {

	@Override
	public Method generateDaoImplMethod() throws Exception{
		return null;
	}

	@Override
	public Method generateDaoMethodDefinition() throws Exception{
		if (this.denied)
			return null;
		else {
			Method method = new Method();
			method.setStandardName(
					"find" + this.domain.getStandardName() + "FullInfoBy" + this.domain.getDomainId().getCapFirstFieldName());
			method.setReturnType(
					new Type(this.domain.getCapFirstDomainNameWithSuffix(), this.domain.getPackageToken()));
			method.addAdditionalImport(this.domain.getPackageToken() + "." + this.domain.getDomainSuffix() + "."
					+ this.domain.getCapFirstDomainNameWithSuffix());
			method.addSignature(new Signature(1, this.domain.getDomainId().getFieldName(),
					this.domain.getDomainId().getClassType()));
			method.setThrowException(true);
			method.addMetaData("Query(\""+JpqlReflector.generateFindFullInfoByIdStatement(domain)+"\")");
			return method;
		}
	}

	@Override
	public Method generateServiceMethodDefinition() throws Exception{
		return null;
	}

	@Override
	public Method generateServiceImplMethod() throws Exception{
		return null;
	}
	
	public FindFullInfoById(){
		super();
		this.setLabel("查找全部信息");
	}
	
	public FindFullInfoById(Domain domain) throws ValidateException{
		super();
		this.domain = domain;
		this.denied = domain.isVerbDenied("Clone");
		this.setVerbName("Find"+StringUtil.capFirst(this.domain.getStandardName())+"FullInfoBy"+this.domain.getDomainId().getCapFirstFieldName());
		this.setLabel("查找全部信息");
		if  (domain.getLanguage().equalsIgnoreCase("english"))  this.setLabel("FindFullInfoById");
	}
}
